package com.soft.face.config.arcsoft.service;

import com.arcsoft.face.FaceInfo;
import com.arcsoft.face.toolkit.ImageInfo;
import com.soft.face.config.arcsoft.entity.ProcessInfo;
import com.soft.face.config.arcsoft.util.UserRamCache;
import com.soft.face.config.arcsoft.entity.UserCompareInfo;
import com.soft.face.global.BusinessException;

import java.util.List;

public interface FaceEngineService {

    /**
     * 人脸检测
     *
     * @param imageInfo
     * @return
     */
    List<FaceInfo> detectFaces(ImageInfo imageInfo);

    /**
     * 人脸对比
     *
     * @param imageInfo1
     * @param imageInfo2
     * @return
     */
    Float compareFace(ImageInfo imageInfo1, ImageInfo imageInfo2) throws BusinessException;

    /**
     * 人脸特征提取
     *
     * @param imageInfo
     * @param faceInfo
     * @return
     */
    byte[] extractFaceFeature(ImageInfo imageInfo, FaceInfo faceInfo);

    /**
     * 人脸检测
     *
     * @param faceFeature
     * @param userInfoList
     * @param passRate
     * @return
     */
    List<UserCompareInfo> faceRecognition(byte[] faceFeature, List<UserRamCache.UserInfo> userInfoList, float passRate);

    List<ProcessInfo> process(ImageInfo imageInfo, List<FaceInfo> faceInfoList);
}
